#include "HeadFile.h"

FileOperation* FileOperation::instance = nullptr;

FileOperation::FileOperation()
{
}

FileOperation::~FileOperation()
{
}

unsigned FileOperation::LoardLength(char* filePath)
{
	unsigned length = 0;
	fopen_s(&file, filePath, "r");
	char temp[255] = {0};
	while(fgets(temp,255,file))
	{
		length++;
	}
	fclose(file);
	return length;
}

unsigned FileOperation::LoardWidth(char* filePath)
{
	unsigned length = 0;
	fopen_s(&file, filePath, "r");
	char temp[255] = { 0 };
	fgets(temp, 255, file);
	fclose(file);
	return strlen(temp);
}


FileOperation* FileOperation::Instance()
{
	if (instance == nullptr)
	{
		instance = new FileOperation;
	}
	return instance;
}
